/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once


#include <节点/节点.h>

#include <core/空间划分/球形八叉树.h>
#include <面/面.h>





class C_射线拾取节点 : public C_节点基类 {
	S_设备环境	m_GPU环境;

public:
	C_射线拾取节点(S_设备环境& ctx);
	~C_射线拾取节点();

	S_Mesh* m_GPU可视网格;
	S_Mesh* m_GPU射线可视网格;
	float32 m_半径范围;
	bool	m_是否以视口射线拾取;
	E_值类型	m_输入的数据类型;

	bool	f_update();

	static vec3	m_视口空间坐标[2];
};


C_节点基类* f_node_载入射线拾取节点(S_设备环境& ctx, FILE* f);
void		f_node_保存射线拾取节点(C_节点基类* n, FILE* f);








class C_范围拾取节点 : public C_节点基类 {
	S_设备环境	m_GPU环境;

public:
	C_范围拾取节点(S_设备环境& ctx);
	~C_范围拾取节点();

	S_Mesh* m_GPU可视网格;
	S_Mesh* m_GPU射线可视网格;
	float32 m_半径范围;
	E_值类型	m_输入的数据类型;

	bool	f_update();

	void	f_范围索取树单元数据(const S_点距八叉树& tree, const std::vector<S_线段>& lines, std::vector<S_八叉树子空间*>& pathTree);

	static vec3	m_视口起点空间坐标;
	static vec3	m_视口终点空间坐标;
};


C_节点基类* f_node_载入范围拾取节点(S_设备环境& ctx, FILE* f);
void		f_node_保存范围拾取节点(C_节点基类* n, FILE* f);









